<?php
	
	/**
	 * Class for creating connection to database.
	 */
	class MysqlConnection
	{
		/**
		 * Connection id.
		 */
		private $connection;
		
		/**
		 * Constructor.
		 * @return NULL
		 * @param string $host
		 * @param string $user
		 * @param string $password
		 * @param string $database
		 */
		public function MysqlConnection( $host, $user, $password )
		{
			$this->connection = mysql_connect( $host, $user, $password );			
		}
		
		
		/**
		 * Select a database for use.
		 * @return result of selection: true/false
		 * @param string $database
		 */
		public function selectDb( $database )
		{
			if( mysql_select_db( $database, $this->connection ) )
				return true;
			return false;
		}
		
		
		/**
		 * Gives back the connection identifier.
		 * @return MySqlConnectionId
		 */
		public function getConnection()
		{
			return $this->connection;
		}
	}

?>